package com.tucanstubs.android_wheresmystuff.login;


/**
 * Admin is a subclass of user. Admins have all of the functionality of a user in addition to the added 
 * privileges of being able to add, remove, and lock user accounts.
 * 
 * @author team 37
 * @version 1.0 2/21/2013
 *
 */
public class Admin extends User {
	/**
	 * Default constructor for Admin class. Takes in user name, first name, last name
	 * password, and email and sets the corresponding 
	 * admin fields. Admin's account state is unlocked by default. Admin's foundItems and searchItems
	 * list are initialized to empty lists.
	 * 
	 * @param name user's name
	 * @param password user's password
	 * @param email user's email
	 */
	public Admin(String userName, String firstName, String lastName, String password, String email){
		super(userName,firstName,lastName,password,email);
	}
	
	/**
	 * Locks the specified user account
	 * @param u the account to be locked
	 */
	public void lockUser(User u){
		u.setLocked(true);
	}
	
	/**
	 * Returns true if this is an instance of Admin, false otherwise
	 * @returns True if Admin, false otherwise
	 */
	@Override
	public boolean isAdmin() {
		return true;
	}
}
